﻿using Asplode.Events;
using BEPUphysics;

namespace Asplode.Physics
{

    public class PhysicsEventHandler:
        BoxSpawnEventHandler,
        HumanSpawnEventHandler,
        RemoveEntityEventHandler,
        ZombieSpawnEventHandler
    {
        Space Space;
        public PhysicsEventHandler(Space space)
        {
            Space = space;
        }


        #region EventHandler<BoxSpawnEvent> Members

        public void handle(BoxSpawnEvent t)
        {
            Space.add(t.Box);
        }

        #endregion

        #region EventHandler<HumanSpawnEvent> Members

        public void handle(HumanSpawnEvent t)
        {
            Space.add(t.entity);
        }

        #endregion

        #region EventHandler<RemoveEntityEvent> Members

        public void handle(RemoveEntityEvent t)
        {
            Space.remove(t.entity);
        }

        #endregion

        #region EventHandler<ZombieSpawnEvent> Members

        public void handle(ZombieSpawnEvent t)
        {
            Space.add(t.entity);
        }

        #endregion


        
    }
}
